Option Explicit

dim theobj, retval, thestr
dim thefolder, objArgs
' cmd> regsvr32.exe miceshot.dll
' if x86.dll and osX64 then 
'	> windows\syswow64\regsvr32.exe miceshot.dll
'	> windows\syswow64\CScript.exe usage.vbs

 thefolder = ""
' bitsPerPixel = 30
 Set objArgs = WScript.Arguments
 If objArgs.Count > 0 Then
    thestr = objArgs(0)
    If Len(thestr) > 1 Then
        If (InStr(Right(thestr, 1), "\") = 0) AND _ 
            (InStr(Right(thestr, 1), "/") = 0) _
                Then thestr = thestr & "/"
        thefolder = thestr
    End If
 End If

Set theobj = CreateObject("oleauto.screenshot")
 WScript.echo "attr( cursor, width, height ): " & vbTAB & "( " & _
    theobj.cursor & ", " & theobj.width & ", " &  theobj.height & " )"

 theobj.cursor = false
 theobj.pixelBits = 24
 thestr = thefolder & "screen.bmp"
 retval = theobj.save(thestr, true)
'   if retval then it is really fullscreen
retval = theobj.length ' test length of pending queue
 theobj.pixelBits = 0 ' resets to screen resolution
 theobj.cursor = True
 thestr = thefolder & "mice.bmp"
 theobj.save thestr, "no"

 WScript.echo "Bits per Pixel (32, 24, 16): " & theobj.pixelBits
 WScript.echo "have finished, full screen: " & retval

Set theobj = Nothing
